package com.polaris.live.ui.live.widget.base

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import androidx.viewpager.widget.VerticalViewPager

/**
 * 带滑动控制的VerticalViewPager
 *
 * @author Created by lucas on 2023/11/8 09:31
 * @since 1.0.0
 */
class LiveVerticalViewPager(context: Context, attrs: AttributeSet?) : VerticalViewPager(context, attrs) {

    override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
        return try {
            super.onInterceptTouchEvent(ev)
        } catch (e: IllegalArgumentException) {
            false
        }
    }

    override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
        return false
    }

    fun onDispatchTouchEvent(ev: MotionEvent?): Boolean {
        return super.dispatchTouchEvent(ev)
    }
}